////////////////////////////////////////////////////////////////////////////////
// Copyright 2010 Michael Schmalle - Teoti Graphix, LLC
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and 
// limitations under the License
// 
// Author: Michael Schmalle, Principal Architect
// mschmalle at teotigraphix dot com
////////////////////////////////////////////////////////////////////////////////

package org.teotigraphix.swizplugin.events
{

import flash.events.Event;

import org.teotigraphix.swizplugin.bundles.IBundle;

/**
 * asd
 * 
 * @author Michael Schmalle
 * @copyright Teoti Graphix, LLC
 * @productversion 1.0
 */
public class BundleEvent extends Event
{
	//--------------------------------------------------------------------------
	//
	//  Public Class :: Properties
	//
	//--------------------------------------------------------------------------
	
	
	public static const BUNDLE_READY:String = "bundleReady";
	
	/**
	 * 
	 * 
	 * @eventType bundleInstalled
	 */
	public static const BUNDLE_INSTALLED:String = "bundleInstalled";
	
	/**
	 * 
	 * 
	 * @eventType bundleStarted
	 */
	public static const BUNDLE_STARTED:String = "bundleStarted";
	
	/**
	 * 
	 * 
	 * @eventType bundleStopped
	 */
	public static const BUNDLE_STOPPED:String = "bundleStopped";
	
	/**
	 * 
	 * 
	 * @eventType bundleUpdated
	 */
	public static const BUNDLE_UPDATED:String = "bundleUpdated";
	
	/**
	 * 
	 * 
	 * @eventType bundleUninstalled
	 */
	public static const BUNDLE_UNINSTALLED:String = "bundleUninstalled";	
	
	/**
	 * 
	 * 
	 * @eventType bundleResolved
	 */
	public static const BUNDLE_RESOLVED:String = "bundleResolved";	
	
	/**
	 * 
	 * 
	 * @eventType bundleUnresolved
	 */
	public static const BUNDLE_UNRESOLVED:String = "bundleUnresolved";	
	
	/**
	 * 
	 * 
	 * @eventType bundleStarting
	 */
	public static const BUNDLE_STARTING:String = "bundleStarting";	
	
	/**
	 * 
	 * 
	 * @eventType bundleStopping
	 */
	public static const BUNDLE_STOPPING:String = "bundleStopping";	
	
	/**
	 * 
	 * 
	 * @eventType bundleLazyActivation
	 */
	public static const BUNDLE_LAZY_ACTIVATION:String = "bundleLazyActivation";	

	//--------------------------------------------------------------------------
	//
	//  Public :: Properties
	//
	//--------------------------------------------------------------------------
	
	//----------------------------------
	//  bundle
	//----------------------------------
	
	/**
	 * The bundle.
	 */
	public var bundle:IBundle;

	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------

	/**
	 * Create a new BundleEvent instance.
	 * 
	 * @param type A string indicating the event type for the 
	 * current instance.
	 * @param bundle The bundle.
	 */
	public function BundleEvent(type:String, bundle:IBundle)
	{
		super(type);
		
		this.bundle = bundle;
	}
	
	//--------------------------------------------------------------------------
	//
	//  Overriden Public :: Methods
	//
	//--------------------------------------------------------------------------

	/**
	 * Creates a clone instance using the current property state of this 
	 * instance.
	 */
	override public function clone():Event
	{
		return new BundleEvent(type, bundle);
	}	
}
}